package com.fot.core;

import com.alibaba.fastjson.JSON;
import com.fot.core.publisher.RedisMQMessagePublisher;

/**
 * @author 殷豪
 */
public class RedisMQTemplate {
    private RedisMQMessagePublisher redisMQMessagePublisher;

    public RedisMQMessagePublisher getRedisMQMessagePublisher() {
        return redisMQMessagePublisher;
    }

    public void setRedisMQMessagePublisher(RedisMQMessagePublisher redisMQMessagePublisher) {
        this.redisMQMessagePublisher = redisMQMessagePublisher;
    }

    public void send(String topic, Object message) {
        redisMQMessagePublisher.publish(topic, JSON.toJSONString(message));
    }
}
